import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
    {
    title: '标题',
    align:"center",
    dataIndex: 'title'
   },
   {
    title: '所属项目',
    align:"center",
    dataIndex: 'project_dictText'
   },
   {
    title: '当前处理人id',
    align:"center",
    dataIndex: 'checkPeopleId'
   },
   {
    title: '报名开始时间',
    align:"center",
    dataIndex: 'applyStartTime'
   },
   {
    title: '报名截止日期',
    align:"center",
    sorter: true,
    dataIndex: 'applyEndTime'
   },
   {
    title: '公示开始日期',
    align:"center",
    dataIndex: 'noticeStartTime'
   },
   {
    title: '公示截止日期',
    align:"center",
    sorter: true,
    dataIndex: 'noticeEndTime'
   },
   {
    title: '核查截止日期',
    align:"center",
    sorter: true,
    dataIndex: 'checkEndTime'
   },
   {
    title: '是否停止报名',
    align:"center",
    dataIndex: 'isStopApply_dictText'
   },
   {
    title: '是否停止核查',
    align:"center",
    dataIndex: 'isStopCheck_dictText'
   },
   {
    title: '是否完结',
    align:"center",
    dataIndex: 'isFinish_dictText'
   },
   {
    title: '当前阶段',
    align:"center",
    dataIndex: 'currentStatus_dictText'
   },
   {
    title: '附件',
    align:"center",
    dataIndex: 'appendix',
    slots: { customRender: 'fileSlot' },
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '所属项目',
    field: 'project',
    component: 'JSearchSelect',
    componentProps:{
       dict:"znzf_project,name,id"
    }
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入所属项目!'},
          ];
     },
  },
  {
    label: '当前处理人id',
    field: 'checkPeopleId',
    component: 'Input',
    dynamicDisabled:true
  },
  {
    label: '报名开始时间',
    field: 'applyStartTime',
    component: 'Input',
  },
  {
    label: '报名截止日期',
    field: 'applyEndTime',
    component: 'Input',
  },
  {
    label: '公示开始日期',
    field: 'noticeStartTime',
    component: 'Input',
  },
  {
    label: '公示截止日期',
    field: 'noticeEndTime',
    component: 'Input',
  },
  {
    label: '核查截止日期',
    field: 'checkEndTime',
    component: 'Input',
  },
  {
    label: '是否停止报名',
    field: 'isStopApply',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"yn"
     }
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入是否停止报名!'},
          ];
     },
  },
  {
    label: '是否停止核查',
    field: 'isStopCheck',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"yn"
     }
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入是否停止核查!'},
          ];
     },
  },
  {
    label: '是否完结',
    field: 'isFinish',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"yn"
     }
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入是否完结!'},
          ];
     },
  },
  {
    label: '当前阶段',
    field: 'currentStatus',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"apply_status"
     }
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入当前阶段!'},
          ];
     },
  },
  {
    label: '附件',
    field: 'appendix',
    component: 'JUpload',
    componentProps:{
     }
  },
];
